/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.siteuserbuy.entity;

import org.hibernate.validator.constraints.Length;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import javax.validation.constraints.NotNull;

import com.thinkgem.jeesite.common.persistence.DataEntity;

/**
 * 生成投资记录Entity
 * @author thinkgem
 * @version 2017-08-21
 */
public class SiteUserBuy extends DataEntity<SiteUserBuy> {
	
	private static final long serialVersionUID = 1L;
	private String orderNo;		// 认购时的流水号:时间戳+userid
	private String userId;		// 交易用户id
	private String amount;		// 交易金额
	private String tureAmount;		// 实投金额
	private String payType;		// 购买方式：1，充值购买 2，活期转定期，3，定期转活期
	private String initialAmount;		// 期初金额
	private String finalAmount;		// 期末金额
	private String changeNo;		// 转入流水号
	private String returnType;		// 赎回方式：99赎回到银行卡，10转到活期，21转投7天，22转投
	private Date applyTime;		// 申购时间
	private String applyDate;		// 申购日期20170726
	private String status;		// 交易状态：0:未处理 1:成功 2:失败 3:异常情况
	private String terminalType;		// 购买渠道：1,web;2,IOS;3,安卓；4,H5；5微信公众号
	private Date replyTime;		// 处理时间/购买成功时间
	private String rate;		// 购买基础年化收益率
	private String addRate;		// 加息劵加息率
	private String cash;		// 使用返现金
	private String info;		// 交易说明
	private String remark;		// 备注
	private String remark1;		// remark1
	private String remark2;		// remark2
	private String redPacketId;		// 红包id
	private String couponId;		// 使用优惠券ID
	private String fee;		// 交易手续费
	private Long orderId;		// 充值对应的投标订单号
	private String productId;		// 认购产品ID
	private String productType;		// 1:活期，2:定期，3:体验标
	private String settleDate;		// 结算日期例子  20170706  索引查询
	private String interestDate;		// 计息日
	private String cashReturnDate;		// 利息返现日
	
	public SiteUserBuy() {
		super();
	}

	public SiteUserBuy(String id){
		super(id);
	}

	@Length(min=0, max=24, message="认购时的流水号:时间戳+userid长度必须介于 0 和 24 之间")
	public String getOrderNo() {
		return orderNo;
	}

	public void setOrderNo(String orderNo) {
		this.orderNo = orderNo;
	}
	
	@Length(min=0, max=7, message="交易用户id长度必须介于 0 和 7 之间")
	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}
	
	public String getAmount() {
		return amount;
	}

	public void setAmount(String amount) {
		this.amount = amount;
	}
	
	public String getTureAmount() {
		return tureAmount;
	}

	public void setTureAmount(String tureAmount) {
		this.tureAmount = tureAmount;
	}
	
	@Length(min=1, max=1, message="购买方式：1，充值购买 2，活期转定期，3，定期转活期长度必须介于 1 和 1 之间")
	public String getPayType() {
		return payType;
	}

	public void setPayType(String payType) {
		this.payType = payType;
	}
	
	public String getInitialAmount() {
		return initialAmount;
	}

	public void setInitialAmount(String initialAmount) {
		this.initialAmount = initialAmount;
	}
	
	public String getFinalAmount() {
		return finalAmount;
	}

	public void setFinalAmount(String finalAmount) {
		this.finalAmount = finalAmount;
	}
	
	@Length(min=0, max=30, message="转入流水号长度必须介于 0 和 30 之间")
	public String getChangeNo() {
		return changeNo;
	}

	public void setChangeNo(String changeNo) {
		this.changeNo = changeNo;
	}
	
	@Length(min=0, max=2, message="赎回方式：99赎回到银行卡，10转到活期，21转投7天，22转投长度必须介于 0 和 2 之间")
	public String getReturnType() {
		return returnType;
	}

	public void setReturnType(String returnType) {
		this.returnType = returnType;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@NotNull(message="申购时间不能为空")
	public Date getApplyTime() {
		return applyTime;
	}

	public void setApplyTime(Date applyTime) {
		this.applyTime = applyTime;
	}
	
	@Length(min=0, max=8, message="申购日期20170726长度必须介于 0 和 8 之间")
	public String getApplyDate() {
		return applyDate;
	}

	public void setApplyDate(String applyDate) {
		this.applyDate = applyDate;
	}
	
	@Length(min=1, max=1, message="交易状态：0:未处理 1:成功 2:失败 3:异常情况长度必须介于 1 和 1 之间")
	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}
	
	@Length(min=0, max=1, message="购买渠道：1,web;2,IOS;3,安卓；4,H5；5微信公众号长度必须介于 0 和 1 之间")
	public String getTerminalType() {
		return terminalType;
	}

	public void setTerminalType(String terminalType) {
		this.terminalType = terminalType;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getReplyTime() {
		return replyTime;
	}

	public void setReplyTime(Date replyTime) {
		this.replyTime = replyTime;
	}
	
	public String getRate() {
		return rate;
	}

	public void setRate(String rate) {
		this.rate = rate;
	}
	
	public String getAddRate() {
		return addRate;
	}

	public void setAddRate(String addRate) {
		this.addRate = addRate;
	}
	
	public String getCash() {
		return cash;
	}

	public void setCash(String cash) {
		this.cash = cash;
	}
	
	@Length(min=0, max=200, message="交易说明长度必须介于 0 和 200 之间")
	public String getInfo() {
		return info;
	}

	public void setInfo(String info) {
		this.info = info;
	}
	
	@Length(min=0, max=128, message="备注长度必须介于 0 和 128 之间")
	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}
	
	@Length(min=0, max=200, message="remark1长度必须介于 0 和 200 之间")
	public String getRemark1() {
		return remark1;
	}

	public void setRemark1(String remark1) {
		this.remark1 = remark1;
	}
	
	@Length(min=0, max=200, message="remark2长度必须介于 0 和 200 之间")
	public String getRemark2() {
		return remark2;
	}

	public void setRemark2(String remark2) {
		this.remark2 = remark2;
	}
	
	@Length(min=0, max=20, message="红包id长度必须介于 0 和 20 之间")
	public String getRedPacketId() {
		return redPacketId;
	}

	public void setRedPacketId(String redPacketId) {
		this.redPacketId = redPacketId;
	}
	
	@Length(min=0, max=20, message="使用优惠券ID长度必须介于 0 和 20 之间")
	public String getCouponId() {
		return couponId;
	}

	public void setCouponId(String couponId) {
		this.couponId = couponId;
	}
	
	public String getFee() {
		return fee;
	}

	public void setFee(String fee) {
		this.fee = fee;
	}
	
	public Long getOrderId() {
		return orderId;
	}

	public void setOrderId(Long orderId) {
		this.orderId = orderId;
	}
	
	@Length(min=0, max=5, message="认购产品ID长度必须介于 0 和 5 之间")
	public String getProductId() {
		return productId;
	}

	public void setProductId(String productId) {
		this.productId = productId;
	}
	
	@Length(min=0, max=1, message="1:活期，2:定期，3:体验标长度必须介于 0 和 1 之间")
	public String getProductType() {
		return productType;
	}

	public void setProductType(String productType) {
		this.productType = productType;
	}
	
	@Length(min=0, max=8, message="结算日期例子  20170706  索引查询长度必须介于 0 和 8 之间")
	public String getSettleDate() {
		return settleDate;
	}

	public void setSettleDate(String settleDate) {
		this.settleDate = settleDate;
	}
	
	@Length(min=0, max=20, message="计息日长度必须介于 0 和 20 之间")
	public String getInterestDate() {
		return interestDate;
	}

	public void setInterestDate(String interestDate) {
		this.interestDate = interestDate;
	}
	
	@Length(min=0, max=20, message="利息返现日长度必须介于 0 和 20 之间")
	public String getCashReturnDate() {
		return cashReturnDate;
	}

	public void setCashReturnDate(String cashReturnDate) {
		this.cashReturnDate = cashReturnDate;
	}
	
}